package demo4;

import demo4.controller.UserController;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import java.sql.SQLException;

public class Demo {
    public static void main(String[] args) throws SQLException {
        /*
        容器创建时，除了制定的包进行扫描外，该包如果还有子孙包，也会记性扫描
         */
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext("demo4");
        UserController userController = context.getBean(UserController.class);
        userController.start();
    }
}
